package com.example.service;

import com.example.entity.Student;
import com.example.entity.Teacher;
import com.example.mapper.KlassMapper;
import com.example.mapper.StudentMapper;
import com.example.mapper.TeacherMapper;
import com.example.vo.StudentParam;
import com.example.vo.StudentVo;
import xyz.lwm.lazycat.annotation.Inject;
import xyz.lwm.lazycat.web.annocation.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ExampleService {

    @Inject
    private KlassMapper klassMapper;

    @Resource
    private StudentMapper studentMapper;

    @Inject
    private TeacherMapper teacherMapper;

    public List<Student> getStudentList() {
        return studentMapper.selectAll();
    }

    public Student getStudentById(Long studentId) {
        return studentMapper.selectOneById(studentId);
    }

    public List<Teacher> getTeacherList() {
        return teacherMapper.selectAll();
    }

    public Teacher getTeacherById(Long teacherId) {
        return teacherMapper.selectOneById(teacherId);
    }

    public List<StudentVo> getStudentsBy(StudentParam param) {
        return studentMapper.getStudentsBy(param);
    }

}
